package com.heima.day531_字符串;

import java.util.Scanner;

public class mgziXXX {
    public static void main(String[] args) {
        //键盘录入一个字符串，用Scanner
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入：");
        String s=sc.nextLine();
        //将所有敏感字符存入一个数组中
        String[]arr={"TMD","tmd","Tmd","sb","SB"};
        //将输入的敏感字进行规则替换
        String s1=s;

        for (int i = 0; i < arr.length; i++) {
            s1=s1.replace(arr[i],"**");
        }
        System.out.println(s1);
    }
}
